home *** CD-ROM | disk | FTP | other *** search
/ Mac-Source 1994 July / Mac-Source_July_1994.iso / C and C++ / Libraries / BlobMgr / Demo Folder / BlobDemo.h < prev    next >
Encoding:
C/C++ Source or Header  |  1994-02-21  |  3.5 KB  |  163 lines  |  [TEXT/KAHL]

  1. /*
  2.  * Blob Manager Demonstration:  Header file
  3.  *
  4.  * 19 July 1986    Paul DuBois
  5.  */
  6.  
  7. # ifndef    __BLOBDEMO_H__
  8.  
  9. # define    __BLOBDEMO_H__
  10.  
  11. /* control hiliting constants */
  12.  
  13. # ifndef    normalHilite
  14. # define    normalHilite    0
  15. # endif
  16. # ifndef    dimHilite
  17. # define    dimHilite        255
  18. # endif
  19.  
  20.  
  21. /*
  22.  * Resource numbers
  23.  */
  24.  
  25. # define    helpTextRes        1000    /* help text */
  26. # define    fshPictRes        1        /* fish picture */
  27. # define    letrSicnNo        130        /* SICN containing hebrew letters */
  28. # define    nameStrNo        130        /* STR# containing letter names */
  29.  
  30.  
  31. enum
  32. {
  33.     aboutAlrtRes = 1000,    /* "About BlobDemo..." alert */
  34.     textDlogRes
  35. };
  36.  
  37. enum        /* window numbers.  the ones between firstWindRes */
  38. {            /* and lastWindRes should be consecutive */
  39.  
  40.     firstWindRes = 1000,
  41.     fggWindRes = firstWindRes,
  42.     farWindRes,
  43.     hebWindRes,
  44.     tttWindRes,
  45.     tohWindRes,
  46.     fshWindRes,
  47.     aliceWindRes,
  48.     radixWindRes,
  49.     magicWindRes,
  50.     statesWindRes,
  51.     hangWindRes,
  52.     pegWindRes,
  53.     anaWindRes,
  54.     swapWindRes,
  55.     wolfWindRes,
  56.     pyrWindRes,
  57.     pongWindRes,
  58.     lastWindRes                /* not a real window - only a placeholder. */
  59.                             /* should come last in list */
  60. };
  61.  
  62.  
  63. enum        /* menu numbers */
  64. {
  65.     fileMenuRes = 256,
  66.     windMenuRes,
  67.     radixMenuRes,
  68.     clickMenuRes,
  69.     donorMenuRes,
  70.     receptorMenuRes,
  71.     editMenuRes,
  72.     swapCnfgMenuRes,
  73.     pegCnfgMenuRes
  74. };
  75.  
  76. enum        /* file menu item numbers */
  77. {
  78.     closeWind = 1,
  79.     closeAll,
  80.     /* ---- */
  81.     getInfo = 4,
  82.     /* ---- */
  83.     quit = 6
  84. };
  85.  
  86. enum        /* edit menu item numbers */
  87. {
  88.     editUndo = 1,
  89.     /* ---- */
  90.     editCut = 3,
  91.     editCopy = 4,
  92.     editPaste = 5,
  93.     editClear = 6
  94. };
  95.  
  96. enum        /* fox, goose, grain icon numbers */
  97. {
  98.     foxIconRes = 1000,
  99.     gooseIconRes,
  100.     grainIconRes,
  101.     farmerIconRes,
  102.     whewIconRes,
  103.     ratsIconRes
  104. };
  105.  
  106. typedef BlobHandle CheckerBoard[8][8];
  107.  
  108. void AnagramInit (void);
  109. void FarInit (void);
  110. void FggInit (void);
  111. void FshInit (void);
  112. void HangInit (void);
  113. void HebInit (void);
  114. void MagicInit (void);
  115. void PegInit (void);
  116. void PongInit (void);
  117. void PyrInit (void);
  118. void RadixInit (void);
  119. void StatesInit (void);
  120. void SwapInit (void);
  121. void TohInit (void);
  122. void TttInit (void);
  123. void WolfInit (void);
  124.  
  125. pascal void    DoMClobber (MenuHandle theMenu);
  126. void    AddWindowTitles (void);
  127. void    SetupMenus (void);
  128. void    CloseAllWindows (void);
  129.  
  130. void StrCpy (StringPtr dst, StringPtr src);
  131. void StrCat (StringPtr dst, StringPtr src);
  132. void MovesLeft (short n, StringPtr s);
  133. BlobHandle NewVButtonBlob (BlobSetHandle bSet, Rect *r, StringPtr title,
  134.                             Boolean visible);
  135. BlobHandle MakeCharBlob (BlobSetHandle bSet, Boolean enable, short glueMVal,
  136.                     Boolean mustMatch, short h, short v, char c);
  137. void SetCharBlobSize (short size);
  138. void MakeBlobGrid (short rows, short cols, short hOff, short vOff,
  139.                     short hWidth, short vHeight, short hGap, short vGap,
  140.                     void (*p) (Rect *r));
  141. void DrawGrid (short rows, short cols, short hOff, short vOff,
  142.                 short hWidth, short vHeight, short hGap, short vGap);
  143. GrafPtr NewOffPort (Rect *r);
  144. void DisposeOffPort (GrafPtr thePort);
  145. void MakeCheckerBoard (BlobSetHandle *boardBlobs, CheckerBoard *board,
  146.                     short pieceSize);
  147. BlobSetHandle MakeCheckersPieces (short pieceSize);
  148. void FindCheckerBoardPos (BlobHandle b, CheckerBoard *board, short *h, short *v);
  149. Boolean CheckerBoardPosEmpty (CheckerBoard *board, short h, short v);
  150. # define CheckerBoardPosFilled(board,h,v)    (!CheckerBoardPosEmpty(board,h,v))
  151.  
  152. WindowPtr GetDemoWind (short resNum);
  153. pascal void DoWClobber (void);
  154. void SetDragRects (GrafPtr thePort);
  155. void MakeFrontWind (WindowPtr w);
  156.  
  157. void TextDialog (short dlogNum, Handle textHandle,
  158.                     short fontNum, short fontSize, Boolean wrap);
  159.  
  160. unsigned char *PickWord (void);
  161.  
  162. # endif    /* __BLOBDEMO_H__ */
  163.